<!-- Veljko Jovanovic -->
<?php
session_start();

include("konekcija_sa_bazom.php");


$pok = $_POST["idpok"];

mysql_query("SET NAMES utf8");

$querry= "DELETE FROM odgovara WHERE idPoklon = '$pok'";
mysql_query($querry)or die(mysql_error());



$querry= "SELECT * FROM komentarpoklona WHERE idPoklon = '$pok'";
$result = mysql_query($querry)or die(mysql_error());

$querry= "DELETE FROM komentarpoklona WHERE idPoklon = '$pok'";
mysql_query($querry)or die(mysql_error());

$querry= "DELETE FROM poklon WHERE idPoklon = '$pok'";
mysql_query($querry)or die(mysql_error());

for($i = 0; $i < mysql_fetch_array($result); $i++){
    $row = mysql_fetch_array($result);

    $id = $row['idKomentar'];
    $querry= "DELETE FROM komentar WHERE idKomentar = '$id'";
    mysql_query($querry)or die(mysql_error());


}






                
mysql_close($veza);


echo"<meta http-equiv='REFRESH' content='0;url=http://localhost/index.php#'>";
?>

